

<div class="layui-form" lay-filter="back-admin-form">
  <div class="layui-form-item">
    <label class="layui-form-label">登录账号</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="hidden" name="id" value="{{ d.params.id || '' }}">
        <input type="text" name="name" value="{{ d.params.name || '' }}" lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">登录密码</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="password" name="password" value="" lay-verify="{{ d.params?'':'required' }}" placeholder="密码" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">角色</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <select name="role_id" id="back-admin-form-role-select">
          {{#  if(!d.params.id){ }}
          <option value="">请选择</option>
          {{#  } }}
        </select>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="checkbox" lay-filter="switch" name="status" {{ d.params.status === 0 ? '' : 'checked' }} lay-skin="switch" lay-text="开启|禁用">
      </script>
    </div>
  </div>
  <div class="layui-form-item" style="text-align: center;">
    <button class="layui-btn" lay-submit lay-filter="back-admin-form-submit">确认</button>
    <button class="layui-btn" type="button" id="layer-close">关闭</button>
  </div>
</div>

<script>
layui.use(['admin', 'form'], function(){
  var $ = layui.$
  ,form = layui.form
  ,setter = layui.setter;
  
});
</script>